package com.yihusitian.zsxq.sg;


import com.yihusitian.zsxq.sg.filter.FilterChain;
import com.yihusitian.zsxq.sg.generator.*;
import com.yihusitian.zsxq.sg.util.CommonInfoHolder;
import lombok.extern.slf4j.Slf4j;

/**
 * @Description 入口
 * @Author LeeHo
 * @Date 2020/8/26 16:10
 */
@Slf4j
public class Entrance {

    public static void main(String[] args) {
        log.info("begin generate source file!");
        CommonInfoHolder.generateConfigHolder.getTableInfoList().forEach(item -> {
            CommonInfoHolder.setCurrentTableInfo(item);
            FilterChain filterChain = new FilterChain()
                    .addFilter(new PreSourceGenerator())
                    .addFilter(new DOSourceGenerator())
                    //DTO对象生成器，需要时开启
//                    .addFilter(new DTOSourceGenerator())
                    //VO对象生成器，需要时开启
//                    .addFilter(new VOSourceGenerator())
                    .addFilter(new MapperSourceGenerator())
                    .addFilter(new ServiceSourceGenerator())
                    .addFilter(new ServiceImplSourceGenerator())
                    ;
            filterChain.doFilter(filterChain);
        });
        log.info("end generate source file!");
    }
}